#include <stdio.h>
#include <stdlib.h>
void solve(int n, int m) {
	int c = (4 * n - m) / 2;
	int r = (m - 2 * n) / 2;
	if (c >= 0 && r >= 0 && c * 2 + 4 * r == m && c + r == n)
		printf("%d %d\n", c, r);
	else
		puts("No answer");
}
int main(void) {
	int a, n, m;
	scanf("%d", &a);
	while (a--) {
		scanf("%d%d", &n, &m);
		solve(n, m);
	}
	return EXIT_SUCCESS;
}
